let formRules = {
  // 必填项
  required: [{
    required: true,
    message: '必填项！',
    trigger: 'change'
  }],
  blurRequired: [{
    required: true,
    message: '必填项！',
    trigger: 'blur'
  }],
  id: [{
    required: true,
    message: '必填项！',
    trigger: 'blur'
  }],
  name: [{
    required: true,
    message: '必填项！',
    trigger: 'blur'
  }],
  state: [{
    required: true,
    message: '必填项！',
    trigger: 'blur'
  }],
  // 手机号码
  mobile: [{
      required: true,
      message: '请输入手机号码',
      trigger: 'blur'
    },
    {
      pattern: /^1[3456789]\d{9}$/,
      message: '请输入正确手机号码',
      trigger: 'blur'
    }
  ],
  length: [{
    length: 1,
    message: '请输入'
  }],
  // 手机号码
  checkmobile: [{
    pattern: /^1[3456789]\d{9}$/,
    message: '请输入正确手机号码'
  }],
  // 数值大于0的正整数-必填
  num: [{
      required: true,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^[1-9]+[0-9]*$/,
      message: '请输入大于0的正整数',
      trigger: 'blur'
    }
  ],
  // 正则表达式匹配数字，包括负数以及小数点
  fnum: [{
      required: true,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^[+-]?\d+(\.\d+)?$/,
      message: '请输入数字',
      trigger: 'blur'
    }
  ],

  // 价格 -不能等于或小于0
  price: [{
      required: true,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^\d+(\.\d+)?$/,
      message: '只允许数值！',
      trigger: 'blur'
    },
    {
      pattern: /^(?!0*(\.0*)?$)/,
      message: '不能等于或小于0！',
      trigger: 'blur'
    }
  ],

  cPrice: [{
      required: true,
      message: '必填项！',
      trigger: 'change'
    },
    {
      pattern: /^(?!0*(\.0*)?$)^\d+(\.\d+)?$/,
      message: '不能等于或小于0！',
      trigger: 'change'
    }
  ],
  // js 正则表达式匹配数字，包括负数以及小数点
  nrPrice: [{
      required: true,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^[+-]?\d+(\.\d+)?$/,
      message: '请输入数字',
      trigger: 'blur'
    }
  ],
  // 只能输入正数和零的正则表达式（正整数、正小数和0）
  pNub: [{
      required: true,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^(([1-9][0-9]*(\.)?[0-9]*)|(0(\.)([0-9]*))|(0))$/,
      message: '请输入0或正数',
      trigger: 'blur'
    }
  ],

  // 数值大于0的正整数-非必填
  nnum: [{
      required: false,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^[1-9]+[0-9]*$/,
      message: '请输入大于0的正整数',
      trigger: 'blur'
    }
  ],
  // 限制数字格式，保留小数点后两位。
  decimal: [{
      required: false,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^\d+(\.\d+)?$/,
      message: '只能为数值',
      trigger: 'blur'
    },
    {
      pattern: /^\d+(\.\d{1,2})?$/,
      message: '小数点后限两位',
      trigger: 'blur'
    }
  ],
  // 限制数字格式，必须数值，不能为负数，不可为0，保留小数点后两位。
  decimalOrZero: [{
      required: true,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^[+-]?\d+(\.\d+)?$/,
      message: '输入错误，请修改!',
      trigger: 'blur'
    },
    {
      pattern: /^(?!0*(\.0*)?$)^\d+(\.\d+)?$/,
      message: '不能小于或等于0!',
      trigger: 'blur'
    },
    // 单个0、不以0开头的整数、以0开头带小数
    {
      pattern: /^(0|^[1-9](\d+)?(\.\d+)?|^0\.\d+(\.\d+)?)$/,
      message: '输入错误，请修改!',
      trigger: 'blur'
    },
    {
      pattern: /^\d+(\.\d{1,2})?$/,
      message: '最多保留小数点后两位!',
      trigger: 'blur'
    }
  ],
  // 限制数字格式，必须数值，不能为负数，不可为0，保留小数点后两位。
  decimalOrZeroF: [{
      required: false,
      message: '必填项！',
      trigger: 'blur'
    },
    {
      pattern: /^[+-]?\d+(\.\d+)?$/,
      message: '输入错误，请修改!',
      trigger: 'blur'
    },
    {
      pattern: /^(?!0*(\.0*)?$)^\d+(\.\d+)?$/,
      message: '不能小于或等于0!',
      trigger: 'blur'
    },
    // 单个0、不以0开头的整数、以0开头带小数
    {
      pattern: /^(0|^[1-9](\d+)?(\.\d+)?|^0\.\d+(\.\d+)?)$/,
      message: '输入错误，请修改!',
      trigger: 'blur'
    },
    {
      pattern: /^\d+(\.\d{1,2})?$/,
      message: '最多保留小数点后两位!',
      trigger: 'blur'
    }
  ],

  // 咨询
  consultForm: {
    catID: [{
      required: true,
      message: '请选择分类',
      trigger: 'change'
    }],
    handleTeamID: [{
      required: true,
      message: '请选择转接组',
      trigger: 'change'
    }],
    handleUserID: [{
      required: true,
      message: '请选择转接员',
      trigger: 'change'
    }],
    customerContent: [{
      required: true,
      message: '请输入咨询内容',
      trigger: 'blur'
    }],
    customerFromID: [{
      required: true,
      message: '请选择来源',
      trigger: 'change'
    }],
    customerContact: [{
        required: true,
        message: '请输入手机号码或者座机号码（如无联系方式，请填入13888888888',
        trigger: 'blur'
      },
      {
        pattern: /^(0\d{2,3}-?\d{7,8})?$|1\d{10}$/,
        message: '请输入手机号码或者座机号码（如无联系方式，请填入13888888888',
        trigger: 'blur'
      }
    ],

    // 跟进咨询
    customerContactName: [{
      required: true,
      message: '请输入客户联系人',
      trigger: 'blur'
    }],
    Industry: [{
      required: true,
      message: '请选择行业',
      trigger: 'change'
    }],
    clientWill: [{
      required: true,
      message: '请选择客户意向',
      trigger: 'change'
    }],
    specification: [{
      required: true,
      message: '请选择咨询质量说明',
      trigger: 'change'
    }],
    result: [{
      required: true,
      message: '请输入行动结果',
      trigger: 'blur'
    }]
  },

  // 工作台组件
  widgetForm: {
    name: [{
      required: true,
      message: '请输入组件名称',
      trigger: 'blur'
    }],
    model: [{
      required: true,
      message: '请输入组件模块名称',
      trigger: 'blur'
    }]
  },

  // 客户/供应商/公海
  userForm: {
    testName: [{
      required: true,
      message: '必填项，请输入抬头/户名',
      trigger: 'blur'
    }],
    testhang: [{
      required: true,
      message: '必填项，请输入开户行',
      trigger: 'blur'
    }],
    testhao: [{
      required: true,
      message: '必填项，请输入开户账号',
      trigger: 'blur'
    }],
    testtonghang: [{
      required: true,
      message: '必填项，请选择同行/他行',
      trigger: 'change'
    }],
    testtongcheng: [{
      required: true,
      message: '必填项，请选择异地/同城',
      trigger: 'change'
    }]
  }
};
export default formRules;
